package com.jcj.jcjsharding.demo.mapper;

import com.jcj.jcjsharding.demo.model.User;
import org.apache.ibatis.annotations.*;

@Mapper
public interface UserMapper {
    @Insert("insert into user(id,name,age) values(#{id},#{name},#{age})")
    int insert(User user);

    @Select("select * from user where id = #{id}")
    User findById(Integer id);

    @Update("update user set name = #{name}, age=#{age} where id = #{id}")
    int update(User user);

    @Delete("delete from user where id = #{id}")
    int delete(Integer id);
}
